package org.example.cloudapply.dto;

import jakarta.validation.constraints.*;
import lombok.Data;
import org.example.cloudapply.entity.CloudType;
import org.example.cloudapply.entity.UserRole;


@Data
public class ApplicationDTO {
    @NotBlank(message = "openid不能为空")
    private String openid;

    @NotBlank(message = "姓名不能为空")
    private String name;

    @NotNull(message = "角色不能为空")
    private UserRole role;

    @NotBlank(message = "学号/工号不能为空")
    private String schoolId;

    @Email(message = "邮箱格式不正确")
    @NotBlank(message = "邮箱不能为空")
    private String email;

    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;

    @NotNull(message = "云平台类型不能为空")
    private CloudType cloudType;

    @NotNull(message = "模板不能为空")
    private Integer templateId;

    private Boolean gpuEnabled = false;

    @NotNull(message = "使用时长不能为空")
    @Min(value = 7, message = "最短租期7天")
    @Max(value = 1095, message = "最长租期36个月")
    private Integer durationDays;
}
